# -*- coding:utf-8 -*-
import unittest, datetime, os
from RequestAssertion import RequestAssertion
from GetData import GetData

# from UI.UploadFiles import UploadFiles
from requests_toolbelt import MultipartEncoder


class TestCaseSet(unittest.TestCase):
    """网站、彩票、活动"""

    # token = Land.token()
    main_url = "http://admin-service-api.yhtest0.com"
    respones = RequestAssertion()
    url = GetData()

    # 断言
    def assertionT(
        self, method, url, interfaceName, data=None, files=None, json=None, headers=None
    ):
        # main_url = TestCaseSet().main_url
        respones = TestCaseSet().respones.request(
            method, url, data, files, json, headers
        )
        self.assertEqual(respones.status_code, 200)
        try:
            self.assertIn(respones.json().get("message"), ["操作成功", "ok", "成功", "登录成功"])
        except:
            self.assertIn(respones.json().get("msg"), ["操作成功", "ok", "成功", "登录成功"])
        print(TestCaseSet.respones.consuming(respones, interfaceName))

    def nowTime(self):
        name = (
            datetime.datetime.now()
            .strftime("%Y-%m-%d %H:%M:%S")
            .replace("-", "")
            .replace(":", "")
            .replace(" ", "")
        )
        return name  # 获取现在时间

    def upload_pic(self):
        # 上传图片
        file = open(os.getcwd() + r"\UI\aototestP.jpeg", "rb")
        files = {"file": ("44ee742ffe4065bae292e34b632c7bdd.jpg", file, "image/jpeg")}
        pic = (
            TestCaseSet()
            .respones.request(
                "files", "http://play-img3.ssg6.com/file/upload", files=files
            )
            .json()
            .get("data")
        )
        file.close()
        return pic

    # App登录充值，后台获取ID
    def app_login(self):
        # 登录
        data = {"account": "13333333332", "pwd": "96e79218965eb72c92a549dd5a330112"}
        head = {
            "Content-Type": "application/x-www-form-urlencoded",
            "pl": "3",
            "seqNo": "9473ba7bbecf439f872b27a6381a178e",
        }
        Authorization = (
            TestCaseSet()
            .respones.request(
                "post_x",
                "http://gateway-api.yhtest0.com/api/user/1.0/login",
                data,
                headers=head,
            )
            .json()
            .get("data")
            .get("token")
        )
        # app线下充值
        head = {"Authorization": Authorization}
        self.assertionT(
            "get",
            "http://gateway-api.yhtest0.com/api/user/1.0/profile",
            "http://gateway-api.yhtest0.com/api/user/1.0/profile, 现金-线下充值",
            headers=head,
        )
        self.assertionT(
            "get",
            "http://gateway-api.yhtest0.com/api/user/1.0/wallet",
            "http://gateway-api.yhtest0.com/api/user/1.0/wallet, 现金-线下充值",
            headers=head,
        )
        data = {
            "bankCode": "ABC",
            "depositAccount": "",
            "depositName": "自动化测试",
            "money": 300000,
            "receiveAccountId": 1,
            "depositTime": "2019-05-23 18:42:44",
        }
        head = {
            "Authorization": Authorization,
            "Content-Type": "application/json",
            "pl": "ios",
        }
        self.assertionT(
            "post",
            "http://gateway-api.yhtest0.com/api/pay/1.0/offline/doPay",
            "http://gateway-api.yhtest0.com/api/pay/1.0/offline/doPay, 现金-线下充值",
            json=data,
            headers=head,
        )
        # 后台现金-线下充值页面获取充值id
        account = (
            TestCaseSet()
            .respones.request(
                "get",
                "http://gateway-api.yhtest0.com/payment/1.0/offline/order/list?status=0&startTime=&endTime=&pageNum=1&pageSize=10",
            )
            .json()
            .get("data")
            .get("data")
        )
        chongz_id = 0
        for ac in account:
            if ac.get("userAccount") == "13333333332":
                chongz_id = ac.get("id")
        # app提现
        data = {"withdrawMoney": 10000, "withdrawPwd": "1111", "withdrawCard": 78}
        head = {
            "Authorization": Authorization,
            "Content-Type": "application/json",
            "pl": "ios",
        }
        self.assertionT(
            "post",
            "http://gateway-api.yhtest0.com/api/user/1.0/wallet/withcash",
            "http://gateway-api.yhtest0.com/api/user/1.0/wallet/withcash, app提现",
            json=data,
            headers=head,
        )
        # 后台现金-人工提存页面获取id
        user = (
            TestCaseSet()
            .respones.request(
                "get",
                "http://gateway-api.yhtest0.com/withcash/1.0/offline/list?pageNum=1&pageSize=10",
            )
            .json()
            .get("data")
            .get("data")
        )
        tix_id = 0
        for us in user:
            if us.get("userAccount") == "13333333332":
                tix_id = us.get("id")

        return chongz_id, tix_id

    def test_website_homepage(self):
        """ 网站-首页设置"""

        url = TestCaseSet().url.getData("website_homepage")
        for u in url:
            self.assertionT("get", u, u + "网站-首页设置")

        self.assertionT(
            "get",
            "http://admin-service-api.yhtest0.com/lottery/1.0/lottery/query?pageNum=1&pageSize=15",
            "/lottery/1.0/lottery/query?pageNum=1&pageSize=15,网站-首页设置-游戏描述",
        )
        self.assertionT(
            "get",
            "http://admin-service-api.yhtest0.com/indexDisplay/1.0/room/list",
            "/indexDisplay/1.0/room/list,网站-首页设置-游戏描述",
        )
        self.assertionT(
            "get",
            "http://admin-service-api.yhtest0.com/indexDisplay/1.0/query",
            "/indexDisplay/1.0/query,网站-首页设置-游戏描述",
        )
        self.assertionT(
            "get",
            "http://admin-service-api.yhtest0.com/lottery/1.0/lottery/query?pageNum=2&pageSize=15",
            "/lottery/1.0/lottery/query?pageNum=2&pageSize=15,网站-首页设置-游戏描述",
        )
        id = (
            TestCaseSet()
            .respones.request(
                "get",
                "http://admin-service-api.yhtest0.com/lottery/1.0/lottery/query?pageNum=1&pageSize=15",
            )
            .json()
            .get("data")
            .get("data")[0]
            .get("id")
        )

        data = {"id": id, "remark": "彩种描述接口自动化"}
        self.assertionT(
            "post_x",
            "http://admin-service-api.yhtest0.com/indexDisplay/1.0/game/describe",
            "/indexDisplay/1.0/game/describe,网站-首页设置-游戏描述",
            data,
        )

        self.assertionT(
            "get",
            "http://admin-service-api.yhtest0.com/indexDisplay/1.0/room/list?modeCode=TRADITION",
            "/indexDisplay/1.0/room/list?modeCode=TRADITION,网站-首页设置-首页展示排序",
        )
        self.assertionT(
            "get",
            "http://admin-service-api.yhtest0.com/indexDisplay/1.0/room/list?modeCode=TRADITION&classCode=XY28",
            "/indexDisplay/1.0/room/list?modeCode=TRADITION&classCode=XY28,网站-首页设置-首页展示排序",
        )
        self.assertionT(
            "get",
            "http://admin-service-api.yhtest0.com/indexDisplay/1.0/room/list?modeCode=TRADITION&classCode=XY28&lotteryCode=2",
            "http://admin-service-api.yhtest0.com/indexDisplay/1.0/room/list?modeCode=TRADITION&classCode=XY28&lotteryCode=2,网站-首页设置-首页展示排序",
        )
        self.assertionT(
            "get",
            "http://admin-service-api.yhtest0.com/indexDisplay/1.0/room/list?modeCode=ROOM&classCode=XY28&lotteryCode=2",
            "/indexDisplay/1.0/room/list?modeCode=ROOM&classCode=XY28&lotteryCode=2,网站-首页设置-首页展示排序",
        )
        self.assertionT(
            "get",
            "http://admin-service-api.yhtest0.com/indexDisplay/1.0/room/list?modeCode=ROOM&classCode=SSC&lotteryCode=2",
            "/indexDisplay/1.0/room/list?modeCode=ROOM&classCode=SSC&lotteryCode=2,网站-首页设置-首页展示排序",
        )
        self.assertionT(
            "get",
            "http://admin-service-api.yhtest0.com/indexDisplay/1.0/room/list?modeCode=ROOM&classCode=SSC",
            "/indexDisplay/1.0/room/list?modeCode=ROOM&classCode=SSC,网站-首页设置-首页展示排序",
        )
        self.assertionT(
            "get",
            "http://admin-service-api.yhtest0.com/indexDisplay/1.0/room/list?modeCode=ROOM&classCode=SSC&lotteryCode=15",
            "/indexDisplay/1.0/room/list?modeCode=ROOM&classCode=SSC&lotteryCode=15,网站-首页设置-首页展示排序",
        )
        self.assertionT(
            "get",
            "http://admin-service-api.yhtest0.com/indexDisplay/1.0/room/list?modeCode=LIVE&classCode=SSC&lotteryCode=15",
            "/indexDisplay/1.0/room/list?modeCode=LIVE&classCode=SSC&lotteryCode=15,网站-首页设置-首页展示排序",
        )
        self.assertionT(
            "get",
            "http://admin-service-api.yhtest0.com/indexDisplay/1.0/room/list?modeCode=LIVE&classCode=6HC&lotteryCode=15",
            "/indexDisplay/1.0/room/list?modeCode=LIVE&classCode=6HC&lotteryCode=15,网站-首页设置-首页展示排序",
        )
        self.assertionT(
            "get",
            "http://admin-service-api.yhtest0.com/indexDisplay/1.0/room/list?modeCode=LIVE&classCode=6HC",
            "/indexDisplay/1.0/room/list?modeCode=LIVE&classCode=6HC,网站-首页设置-首页展示排序",
        )
        self.assertionT(
            "get",
            "http://admin-service-api.yhtest0.com/indexDisplay/1.0/room/list?modeCode=LIVE&classCode=6HC&lotteryCode=28",
            "/indexDisplay/1.0/room/list?modeCode=LIVE&classCode=6HC&lotteryCode=28,网站-首页设置-首页展示排序",
        )

        datas = """[{"displays":[{"lotteryCode":"CQSSC","lotteryName":"重庆时时彩","hallId":78,"roomId":14,"modeCode":"TRADITION","modeName":"传统模式","describe":"彩种描述","streamUrl":"","pic":"http://192.168.10.35/pics/7020.jpg","sort":1},{"lotteryCode":"CQSSC","lotteryName":"重庆时时彩","hallId":79,"roomId":18,"modeCode":"LIVE","modeName":"直播模式","describe":"房间名称","streamUrl":"111","pic":"http://192.168.10.35/pics/7020.jpg","sort":2},{"lotteryCode":"WFC","lotteryName":"五分彩","hallId":78,"roomId":14,"modeCode":"TRADITION","modeName":"传统模式","describe":"彩种描述","streamUrl":"","pic":"http://192.168.10.35/pics/7020.jpg","sort":3},{"lotteryCode":"BJXY28","lotteryName":"北京幸运28","hallId":1,"roomId":1,"modeCode":"ROOM","modeName":"房间模式","describe":"彩种描述接口自动化","streamUrl":"","pic":"http://upload.qianlong.com/2019/0129/1548729441967.jpg","sort":4}],"partName":"part1"},{"displays":[{"lotteryCode":"BJXY28","lotteryName":"北京幸运28","hallId":1,"roomId":3,"modeCode":"ROOM","modeName":"房间模式","describe":"彩种描述aaatest","streamUrl":"","pic":"http://upload.qianlong.com/2019/0129/1548729441967.jpg","sort":1}],"partName":"part2"}]"""
        m = MultipartEncoder(fields={"datas": datas})
        headers = {"Content-Type": m.content_type}

        self.assertionT(
            "post_x",
            "http://admin-service-api.yhtest0.com/indexDisplay/1.0/insert",
            "/indexDisplay/1.0/insert,网站-首页设置-首页展示排序",
            m,
            headers,
        )
        self.assertionT(
            "get",
            "http://admin-service-api.yhtest0.com/indexDisplay/1.0/room/list?modeCode=LIVE&classCode=6HC&lotteryCode=28",
            "/indexDisplay/1.0/room/list?modeCode=LIVE&classCode=6HC&lotteryCode=28,网站-首页设置-首页展示排序",
        )
        self.assertionT(
            "get",
            "http://admin-service-api.yhtest0.com/indexDisplay/1.0/query",
            "/indexDisplay/1.0/query,网站-首页设置-首页展示排序",
        )

    def test_website_advertisement(self):
        """ 网站-广告管理"""
        self.assertionT(
            "get",
            "http://admin-service-api.yhtest0.com/indexAds/1.0/query?pageSize=10&pageNum=1",
            "http://admin-service-api.yhtest0.com/indexAds/1.0/query?pageSize=10&pageNum=1,网站-广告管理",
        )
        self.assertionT(
            "get",
            "http://admin-service-api.yhtest0.com/indexAds/1.0/query?pageSize=10&pageNum=2",
            "http://admin-service-api.yhtest0.com/indexAds/1.0/query?pageSize=10&pageNum=2,网站-广告管理",
        )

        # 新增广告
        pic = TestCaseSet().upload_pic()
        for i in range(4):
            data = {
                "sort": 1,
                "pic": pic,
                "terminal": i,
                "name": "自动化测试",
                "location": 1,
                "showType": 0,
                "linkType": 1,
                "relatedContent": "www.baidu.com",
                "status": 1,
            }

            self.assertionT(
                "post_x",
                "http://gateway-api.yhtest0.com/indexAds/1.0/insert",
                "http://gateway-api.yhtest0.com/indexAds/1.0/insert?,网站-广告管理-新增广告",
                data,
            )

        query = (
            TestCaseSet()
            .respones.request(
                "get",
                "http://admin-service-api.yhtest0.com/indexAds/1.0/query?pageSize=10&pageNum=1",
            )
            .json()
            .get("data")
            .get("data")
        )
        id = 65
        for qu in query:
            if qu.get("name") == "自动化测试":
                id = qu.get("id")

        data = {
            "name": "自动化测试",
            "pic": "http://192.168.10.35/pics/7020.jpg",
            "terminal": 2,
            "location": 1,
            "showType": 0,
            "linkType": 1,
            "sort": 3,
            "status": 1,
            "relatedContent": "www.baidu.com",
            "id": id,
        }
        self.assertionT(
            "post_x",
            "http://admin-service-api.yhtest0.com/indexAds/1.0/update",
            "/indexAds/1.0/update,网站-广告管理-修改",
            data,
        )
        data = {"id": id, "status": 0}
        self.assertionT(
            "post_x",
            "http://admin-service-api.yhtest0.com/indexAds/1.0/update",
            "/indexAds/1.0/update,网站-广告管理-停用",
            data,
        )
        data = {"id": id, "status": 1}
        self.assertionT(
            "post_x",
            "http://admin-service-api.yhtest0.com/indexAds/1.0/update",
            "/indexAds/1.0/update,网站-广告管理-启动",
            data,
        )

        m = MultipartEncoder(fields={"id": id})
        headers = {"Content-Type": m.content_type}
        self.assertionT(
            "post_x",
            "http://admin-service-api.yhtest0.com/indexAds/1.0/delete",
            "/indexAds/1.0/update,网站-广告管理-删除",
            m,
            headers,
        )

        self.assertionT(
            "get",
            "http://admin-service-api.yhtest0.com/indexAds/1.0/query?terminal=0&location=1&showType=0&status=1&linkType=1&pageSize=10&pageNum=1",
            "/indexAds/1.0/query?terminal=0&location=1&showType=0&status=1&linkType=1&pageSize=10&pageNum=1,网站-广告管理-查询",
        )

        self.assertionT(
            "get",
            "http://admin-service-api.yhtest0.com/indexAds/1.0/query?terminal=0&location=1&showType=0&status=0&linkType=1&pageSize=10&pageNum=1",
            "/indexAds/1.0/query?terminal=0&location=1&showType=0&status=0&linkType=1&pageSize=10&pageNum=1,网站-广告管理-查询",
        )

    def test_user_membership_management(self):
        """ 用户-会员管理"""
        username = TestCaseSet().nowTime()
        url = TestCaseSet().url.getData("user_membership_management")
        for u in url:
            self.assertionT("get", u, u + "用户-会员管理")

        # 标签按钮存在bug
        data = {"username": username, "password": 111111, "isTest": 0}
        self.assertionT(
            "post_x",
            "http://admin-service-api.yhtest0.com/user/1.0/register",
            "/user/1.0/register,用户-用户管理-新增用户",
            data,
        )
        id = (
            TestCaseSet()
            .respones.request(
                "get",
                "http://admin-service-api.yhtest0.com/user/1.0/info/list?pageSize=50&pageNum=1&username="
                + str(username),
            )
            .json()
            .get("data")
            .get("data")[0]
            .get("id")
        )
        data = {"id": id, "status": 0}
        self.assertionT(
            "post_x",
            "http://admin-service-api.yhtest0.com/user/1.0/info/setting",
            "/user/1.0/info/setting,用户-用户管理-停用",
            data,
        )
        data = {"id": id, "status": 1}
        self.assertionT(
            "post_x",
            "http://admin-service-api.yhtest0.com/user/1.0/info/setting",
            "/user/1.0/info/setting,用户-用户管理-启用",
            data,
        )
        self.assertionT(
            "get",
            "http://admin-service-api.yhtest0.com/user/1.0/info?uid=" + str(id),
            "/user/1.0/info?uid=,用户-用户管理-用户详情",
        )
        self.assertionT(
            "get",
            "http://admin-service-api.yhtest0.com/userBankAccount/accountList?userId="
            + str(id),
            "/userBankAccount/accountList?userId=,用户-用户管理-用户详情",
        )
        self.assertionT(
            "get",
            "http://admin-service-api.yhtest0.com/bank/list",
            "/bank/list,用户-用户管理-用户详情",
        )
        self.assertionT(
            "get",
            "http://admin-service-api.yhtest0.com/userAccount/1.0/dml?userId="
            + str(id),
            "/userAccount/1.0/dml?userId=,用户-用户管理-用户详情",
        )
        data = {"id": id, "password": 111111}
        self.assertionT(
            "post_x",
            "http://admin-service-api.yhtest0.com/user/1.0/info/setting",
            "/user/1.0/info/setting,用户-用户管理-用户详情-重置登录密码",
            data,
        )
        data = {"id": id, "password": 1111}
        self.assertionT(
            "post_x",
            "http://admin-service-api.yhtest0.com/userAccount/1.0/update",
            "/userAccount/1.0/update,用户-用户管理-用户详情-重置登录密码",
            data,
        )
        self.assertionT(
            "get",
            "http://admin-service-api.yhtest0.com/user/1.0/info?uid=" + str(id),
            "/user/1.0/info?uid=,用户-用户管理-用户详情-用户改名",
        )
        data = {"id": id}
        self.assertionT(
            "post_x",
            "http://admin-service-api.yhtest0.com/user/1.0/info/setting",
            "/user/1.0/info/setting,用户-用户管理-用户详情-保存基本信息",
            data,
        )
        data = {"id": id, "status": 3}
        self.assertionT(
            "post_x",
            "http://admin-service-api.yhtest0.com/user/1.0/info/setting",
            "/user/1.0/info/setting,用户-用户管理-用户详情-封号",
            data,
        )
        data = {"id": id, "status": 0}
        self.assertionT(
            "post_x",
            "http://admin-service-api.yhtest0.com/user/1.0/info/setting",
            "/user/1.0/info/setting,用户-用户管理-用户详情-解封",
            data,
        )
        data = {"id": id, "status": 1}
        self.assertionT(
            "get",
            "http://gateway-api.yhtest0.com/user/statistics/1.0/info?userId=" + str(id),
            "/userBankAccount/accountList?userId=,用户-用户管理-用户详情-统计信息",
        )
        self.assertionT(
            "post_x",
            "http://admin-service-api.yhtest0.com/user/1.0/info/setting",
            "/user/1.0/info/setting,用户-用户管理-用户详情-启用",
            data,
        )
        self.assertionT(
            "get",
            "http://admin-service-api.yhtest0.com/userBankAccount/accountList?userId="
            + str(id),
            "/userBankAccount/accountList?userId=,用户-用户管理-用户详情-账号余额",
        )
        data = {
            "userId": id,
            "bankId": 1,
            "bankName": "自动化测试",
            "accountNo": 6212262201023557228,
            "accountName": "自动化测试",
        }
        self.assertionT(
            "post_x",
            "http://admin-service-api.yhtest0.com/userBankAccount/add",
            "/userBankAccount/add,用户-用户管理-用户详情-新增银行卡",
            data,
        )
        self.assertionT(
            "get",
            "http://admin-service-api.yhtest0.com/userBankAccount/accountList?userId="
            + str(id),
            "/userBankAccount/accountList?userId=,用户-用户管理-用户详情-新增银行卡",
        )
        id_y = (
            TestCaseSet()
            .respones.request(
                "get",
                "http://admin-service-api.yhtest0.com/userBankAccount/accountList?userId="
                + str(id),
            )
            .json()
            .get("data")[0]
            .get("id")
        )
        data = {
            "userId": id,
            "bankId": 1,
            "bankName": "自动化测试",
            "accountNo": 6212262201023557228,
            "accountName": "自动化测试",
            "userBankAccountId": id_y,
        }
        self.assertionT(
            "post_x",
            "http://admin-service-api.yhtest0.com/userBankAccount/edit",
            "/userBankAccount/edit,用户-用户管理-用户详情-修改银行卡",
            data,
        )
        data = {"userBankAccountId": id_y}
        self.assertionT(
            "post_x",
            "http://admin-service-api.yhtest0.com/userBankAccount/updateStatus",
            "/userBankAccount/updateStatus,用户-用户管理-用户详情-银行卡-停用",
            data,
        )
        self.assertionT(
            "post_x",
            "http://admin-service-api.yhtest0.com/userBankAccount/updateStatus",
            "/userBankAccount/updateStatus,用户-用户管理-用户详情-银行卡-启用",
            data,
        )
        data = {"userBankAccountId": id_y}
        self.assertionT(
            "post_x",
            "http://admin-service-api.yhtest0.com/userBankAccount/delete",
            "/userBankAccount/delete,用户-用户管理-用户详情-银行卡-删除",
            data,
        )
        self.assertionT(
            "get",
            "http://admin-service-api.yhtest0.com/userBankAccount/accountList?userId="
            + str(id),
            "/userBankAccount/accountList?userId=,用户-用户管理-用户详情-账号余额",
        )
        self.assertionT(
            "get",
            "http://gateway-api.yhtest0.com/lottery/1.0/betOrder/betOrderPageList?userName="
            + username
            + "&serialNo=&issueNo=&lotteryCode=&modeCode=&sourceType=&startTime=&endTime=&pageSize=10&pageNum=1&status=",
            "/userBankAccount/accountList?userId=,用户-用户管理-订单",
        )
        self.assertionT(
            "get",
            "http://gateway-api.yhtest0.com/userAccount/1.0/accountInfo?username="
            + username,
            "/userBankAccount/accountList?userId=,用户-用户管理-钱包",
        )
        data = {
            "mainMoney": 100000,
            "requiredDml": 100000,
            "discount": 100000,
            "remark": "手动存款",
            "uid": id,
        }
        self.assertionT(
            "post_x",
            "http://gateway-api.yhtest0.com/userAccount/1.0/manualDeposit",
            "/userBankAccount/delete,用户-用户管理-钱包-手动存款",
            data,
        )
        data = {"mainMoney": -10000, "remark": "手动扣款", "uid": id}
        self.assertionT(
            "post_x",
            "http://gateway-api.yhtest0.com/userAccount/1.0/manualDeduct",
            "/userBankAccount/delete,用户-用户管理-钱包-手动减少余额",
            data,
        )
        data = {"mainMoney": -10000, "remark": "手动减少余额", "uid": id}
        self.assertionT(
            "post_x",
            "http://gateway-api.yhtest0.com/userAccount/1.0/manual/reduceMoney",
            "/userBankAccount/delete,用户-用户管理-钱包-手动减少余额",
            data,
        )
        data = {
            "mainMoney": 100000,
            "requiredDml": 100000,
            "remark": "手动增加余额",
            "uid": id,
        }
        self.assertionT(
            "post_x",
            "http://gateway-api.yhtest0.com/userAccount/1.0/manual/incrementMoney",
            "/userBankAccount/delete,用户-用户管理-钱包-手动增加余额",
            data,
        )
        data = {"requiredDml": 1000, "remark": "增加打码量", "uid": id}
        self.assertionT(
            "post_x",
            "http://gateway-api.yhtest0.com/userAccount/1.0/manual/modifyDml",
            "/userBankAccount/delete,用户-用户管理-钱包-增加打码量",
            data,
        )
        data = {"requiredDml": -1000, "remark": "减少打码量", "uid": id}
        self.assertionT(
            "post_x",
            "http://gateway-api.yhtest0.com/userAccount/1.0/manual/modifyDml",
            "/userBankAccount/delete,用户-用户管理-钱包-减少打码量",
            data,
        )
        data = {"drawMoney": 1000, "remark": "增加可提余额", "uid": id}
        self.assertionT(
            "post_x",
            "http://gateway-api.yhtest0.com/userAccount/1.0/manual/modifyDraw",
            "/userBankAccount/delete,用户-用户管理-钱包-增加可提余额",
            data,
        )
        data = {"drawMoney": -1000, "remark": "减少可提余额", "uid": id}
        self.assertionT(
            "post_x",
            "http://gateway-api.yhtest0.com/userAccount/1.0/manual/modifyDraw",
            "/userBankAccount/delete,用户-用户管理-钱包-增加可提余额",
            data,
        )

    def test_user_grade(self):
        """ 用户-会员等级"""
        url = TestCaseSet().url.getData("user_grade")
        for u in url:
            self.assertionT("get", u, u + "用户-会员等级")
        data = {
            "icon": "http://res.tupac2.com//thumbnail%2FGALAXY%2F20190508%2F1557286492944.png",
            "chargeMoney": 0,
            "orderMoney": 0,
            "promoteMoney": 0,
            "transferMoneyPercent": 0.1,
            "drawDmlPercent": 0.1,
            "id": 1,
            "name": "LV1",
        }
        self.assertionT(
            "post_x",
            "http://gateway-api.yhtest0.com/userLevel/update",
            "/userBankAccount/delete,用户-会员等级",
            data,
        )
        strategy = (
            """[{"begin":0,"end":500000,"seq":1,"dml_ratio":0,"refund":3000000}]"""
        )
        data = {
            "betAmount": 1000,
            "type": 1,
            "way": 1,
            "maxLimit": 0,
            "refundTime": "08:00:01",
            "status": 1,
            "strategy": strategy,
            "userLevelId": 1,
            "id": 1,
        }
        self.assertionT(
            "post_x",
            "http://gateway-api.yhtest0.com/userRefund/update",
            "/userBankAccount/delete,用户-会员等级",
            data,
        )

    def test_agency_level(self):
        """ 用户-代理层级"""
        url = TestCaseSet().url.getData("agency_level")
        for u in url:
            self.assertionT("get", u, u + "用户-代理层级")
        data = {"name": "九级代理", "lotteryPerecnt": 0.05}
        self.assertionT(
            "post_x",
            "http://gateway-api.yhtest0.com/agentConfig/1.0/addConfig",
            "/userBankAccount/delete,用户-代理层级-新增代理层级",
            data,
        )
        data = {"name": "九级代理", "lotteryPerecnt": 0.05}
        self.assertionT(
            "post_x",
            "http://gateway-api.yhtest0.com/agentConfig/1.0/delete",
            "http://gateway-api.yhtest0.com/agentConfig/1.0/delete用户-代理层级-删除代理层级",
            data,
        )

    def test_report_form(self):
        """ 报表-总报表"""
        url = TestCaseSet().url.getData("report_form")
        for u in url:
            self.assertionT("get", u, u + "报表-总报表")

    def test_cash_account(self):
        """ 现金-收款账户"""
        url = TestCaseSet().url.getData("cash_account")
        for u in url:
            self.assertionT("get", u, u + "现金-收款账户")
        data = {"name": "九级代理", "lotteryPerecnt": 0.05}
        self.assertionT(
            "post_x",
            "http://gateway-api.yhtest0.com/agentConfig/1.0/addConfig",
            "http://gateway-api.yhtest0.com/agentConfig/1.0/addConfig,现金-收款账户",
            data,
        )

    def test_cash_offline_recharge(self):
        """ 现金-线下充值"""
        url = TestCaseSet().url.getData("cash_offline_recharge")
        for u in url:
            self.assertionT("get", u, u + " 现金-线下充值")

        # 产生充值记录
        id = TestCaseSet().app_login()[0]
        data = {"id": id, "type": 0}
        self.assertionT(
            "post_x",
            "http://gateway-api.yhtest0.com/payment/1.0/offline/order/success",
            "http://gateway-api.yhtest0.com/payment/1.0/offline/order/success, 现金-线下充值-同意",
            data,
        )
        id = TestCaseSet().app_login()[0]
        self.assertionT(
            "get",
            "http://gateway-api.yhtest0.com/payment/1.0/offline/order/" + str(id),
            "http://gateway-api.yhtest0.com/payment/1.0/offline/order/+str(id), 现金-线下充值-详情",
        )
        id = TestCaseSet().app_login()[0]
        data = {"id": id, "remark": "自动化测试"}
        self.assertionT(
            "post_x",
            "http://gateway-api.yhtest0.com/payment/1.0/offline/order/refuse",
            "http://gateway-api.yhtest0.com/payment/1.0/offline/order/refuse, 现金-线下充值-拒绝",
            data,
        )

    def test_cash_online_recharge(self):
        """ 现金-线上充值"""
        url = TestCaseSet().url.getData("cash_online_recharge")
        for u in url:
            self.assertionT("get", u, u + " 现金-线上充值")

    def test_third_party_payment(self):
        """ 现金-第三方支付"""
        url = TestCaseSet().url.getData("third_party_payment")
        for u in url:
            self.assertionT("get", u, u + " 现金-第三方支付")
        data = {"id": 14, "status": 1}
        self.assertionT(
            "post_x",
            "http://gateway-api.yhtest0.com/payment/1.0/customer/payType/status/update",
            "http://gateway-api.yhtest0.com/payment/1.0/customer/payType/status/update, 现金-第三方支付-启动",
            data,
        )
        data = {"id": 14, "status": 0}
        self.assertionT(
            "post_x",
            "http://gateway-api.yhtest0.com/payment/1.0/customer/payType/status/update",
            "http://gateway-api.yhtest0.com/payment/1.0/customer/payType/status/update, 现金-第三方支付-停用",
            data,
        )
        data = {
            "minLimit": 100,
            "maxLimit": 2000000,
            "dayStopAmount": 0,
            "dayAmount": 0,
            "seq": 10,
            "status": 0,
            "id": 14,
        }
        self.assertionT(
            "post_x",
            "http://gateway-api.yhtest0.com/payment/1.0/customer/payType/update",
            "http://gateway-api.yhtest0.com/payment/1.0/customer/payType/update, 现金-第三方支付-编辑",
            data,
        )

    def test_cash_audit(self):
        """ 现金-提现审核"""
        url = TestCaseSet().url.getData("cash_audit")
        for u in url:
            self.assertionT("get", u, u + " 现金-提现审核")
        # app发起提现审核
        id = TestCaseSet().app_login()[1]
        data = {}
        self.assertionT(
            "post_x",
            "http://gateway-api.yhtest0.com/withcash/1.0/offline/success/" + str(id),
            "http://gateway-api.yhtest0.com/withcash/1.0/offline/success/, 现金-提现审核-打款成功",
            data,
        )
        # app发起提现审核
        id = TestCaseSet().app_login()[1]
        data = {"id": id, "remark": "自动化测试"}
        self.assertionT(
            "post_x",
            "http://gateway-api.yhtest0.com/withcash/1.0/offline/refuse",
            "http://gateway-api.yhtest0.com/withcash/1.0/offline/refuse?, 现金-提现审核-拒绝打款",
            data,
        )

    def test_artificial_deposit(self):
        """ 现金-人工提存"""
        url = TestCaseSet().url.getData("artificial_deposit")
        for u in url:
            self.assertionT("get", u, u + " 现金-人工提存")
        self.assertionT(
            "get",
            "http://gateway-api.bib5.com/api/issueInfo/1.0/page?lotteryCode=FFC&pageNo=1&pageSize=10",
            "http://gateway-api.bib5.com/api/issueInfo/1.0/page?lotteryCode=FFC&pageNo=1&pageSize=10, 直播开奖",
        )

    def test_trading_flow(self):
        """ 现金-交易流水"""
        url = TestCaseSet().url.getData("trading_flow")
        for u in url:
            self.assertionT("get", u, u + " 现金-交易流水")

    def test_cash_receiving_account(self):
        """ 现金-收款账号"""

        url = TestCaseSet().url.getData("cash_receiving_account")
        for u in url:
            self.assertionT("get", u, u + "现金-收款账号")

        # 新增收款账号
        pic = TestCaseSet().upload_pic()
        data = {
            "payTypeCode": "WY",
            "bankCode": "ABC",
            "bankInit": "zdhtest",
            "accountName": "zdhtest",
            "account": "zdhtest",
            "minLimit": "1000",
            "maxLimit": "100000",
            "dayStopAmount": "10000",
            "stopAmount": "100000",
            "seq": "1",
            "status": "1",
            "remark": "zdhtest",
            "bankName": "中国农业银行",
        }
        self.assertionT(
            "post_x",
            "http://gateway-api.yhtest0.com/payment/1.0/offline/receiveAccount/add",
            "http://gateway-api.yhtest0.com/payment/1.0/offline/receiveAccount/add,现金-收款账号-新增收款账号-网银",
            data,
        )
        payTypeCode = ["ZFB", "WX", "QQ", "JD"]
        for pay in payTypeCode:
            data = {
                "payTypeCode": pay,
                "bankCode": "ABC",
                "bankInit": "zdhtest",
                "accountName": "zdhtest",
                "account": "zdhtest",
                "qrcodeUrl": pic,
                "minLimit": "1000",
                "maxLimit": "100000",
                "dayStopAmount": "10000",
                "stopAmount": "100000",
                "seq": "1",
                "status": "1",
                "remark": "zdhtest",
            }
            self.assertionT(
                "post_x",
                "http://gateway-api.yhtest0.com/payment/1.0/offline/receiveAccount/add",
                "http://gateway-api.yhtest0.com/payment/1.0/offline/receiveAccount/add,现金-收款账号-新增收款账号",
                data,
            )

    def test_user_label(self):
        """ 用户-会员标签"""
        data = {"name": "自动化测试标签", "describe": "自动化测试标签", "createdId": 1}
        self.assertionT(
            "post_x",
            "http://admin-service-api.yhtest0.com/userTag/1.0/insert",
            "/userTag/1.0/insert,用户-会员标签-新增标签",
            data,
        )
        self.assertionT(
            "get",
            "http://admin-service-api.yhtest0.com/userTag/1.0/listAll",
            "/userTag/1.0/listAll,用户-会员标签",
        )
        listAll = (
            TestCaseSet()
            .respones.request(
                "get", "http://admin-service-api.yhtest0.com/userTag/1.0/listAll"
            )
            .json()
            .get("data")
        )
        id = 2
        for i in listAll:
            try:
                i.get("name") == "自动化测试标签"
            except:
                print("标签不存在")
            else:
                id = i.get("id")
        data = {"name": "自动化测试标签", "describe": "自动化测试标签", "id": id}
        self.assertionT(
            "post_x",
            "http://admin-service-api.yhtest0.com/userTag/1.0/update",
            "/userTag/1.0/update,用户-会员标签-编辑标签",
            data,
        )
        data = {"id": id}
        self.assertionT(
            "post_x",
            "http://admin-service-api.yhtest0.com/userTag/1.0/delete",
            "/userTag/1.0/delete,用户-会员标签-删除标签",
            data,
        )

    def test_lottery_setup(self):
        """ 彩票-彩种设定"""
        data = {"isMainSwitch": 1, "id": 1, "status": 0}
        self.assertionT(
            "post_x",
            "http://admin-service-api.yhtest0.com/lottery/1.0/lottery/updateLotterySwitch",
            "/lottery/1.0/lottery/updateLotterySwitch,彩票-彩种设定-彩种开关-总开关-关",
            data,
        )
        data = {"isMainSwitch": 1, "id": 1, "status": 1}
        self.assertionT(
            "post_x",
            "http://admin-service-api.yhtest0.com/lottery/1.0/lottery/updateLotterySwitch",
            "/lottery/1.0/lottery/updateLotterySwitch,彩票-彩种设定-彩种开关-总开关-开",
            data,
        )
        self.assertionT(
            "get",
            "http://admin-service-api.yhtest0.com/lottery/1.0/lottery/lotterySwitchList",
            "/lottery/1.0/lottery/lotterySwitchList,彩票-彩种设定-彩种开关",
        )

        data = {"isMainSwitch": 2, "id": 1, "status": 0}
        self.assertionT(
            "post_x",
            "http://admin-service-api.yhtest0.com/lottery/1.0/lottery/updateLotterySwitch",
            "/lottery/1.0/lottery/updateLotterySwitch,彩票-彩种设定-彩种开关-传统模式开关-关",
            data,
        )
        data = {"isMainSwitch": 2, "id": 1, "status": 1}
        self.assertionT(
            "post_x",
            "http://admin-service-api.yhtest0.com/lottery/1.0/lottery/updateLotterySwitch",
            "/lottery/1.0/lottery/updateLotterySwitch,彩票-彩种设定-彩种开关-传统模式开关-开",
            data,
        )
        self.assertionT(
            "get",
            "http://admin-service-api.yhtest0.com/lottery/1.0/lottery/lotterySwitchList",
            "/lottery/1.0/lottery/lotterySwitchList,彩票-彩种设定-彩种开关",
        )

        data = {"isMainSwitch": 2, "id": 3, "status": 0}
        self.assertionT(
            "post_x",
            "http://admin-service-api.yhtest0.com/lottery/1.0/lottery/updateLotterySwitch",
            "/lottery/1.0/lottery/updateLotterySwitch,彩票-彩种设定-彩种开关-直播模式开关-开",
            data,
        )
        data = {"isMainSwitch": 2, "id": 3, "status": 1}
        self.assertionT(
            "post_x",
            "http://admin-service-api.yhtest0.com/lottery/1.0/lottery/updateLotterySwitch",
            "/lottery/1.0/lottery/updateLotterySwitch,彩票-彩种设定-彩种开关-直播模式开关-关",
            data,
        )
        self.assertionT(
            "get",
            "http://admin-service-api.yhtest0.com/lottery/1.0/lottery/lotterySwitchList",
            "/lottery/1.0/lottery/lotterySwitchList,彩票-彩种设定-彩种开关",
        )

        self.assertionT(
            "get",
            "http://admin-service-api.yhtest0.com/lottery/1.0/lotteryMobilePurchase/lotteryList",
            "/lottery/1.0/lotteryMobilePurchase/lotteryList,彩票-彩种设定-购彩大厅排序",
        )

        data = """[{"lotteryCode":"XJSSC","seq":1},{"lotteryCode":"XYFT","seq":2},{"lotteryCode":"JSSC","seq":3},{"lotteryCode":"BJXY28","seq":4},{"lotteryCode":"XXLXY28","seq":5},{"lotteryCode":"JNDXY28","seq":6},{"lotteryCode":"XNXY28","seq":7},{"lotteryCode":"TWXY28","seq":8},{"lotteryCode":"JLPXY28","seq":9},{"lotteryCode":"GXK3","seq":10},{"lotteryCode":"JSK3","seq":11},{"lotteryCode":"AHK3","seq":12},{"lotteryCode":"JLK3","seq":13},{"lotteryCode":"CQSSC","seq":14},{"lotteryCode":"TJSSC","seq":15},{"lotteryCode":"WFC","seq":16},{"lotteryCode":"FFC","seq":17},{"lotteryCode":"FLB3FC","seq":18},{"lotteryCode":"HL1.5FC","seq":19},{"lotteryCode":"JX11X5","seq":20},{"lotteryCode":"FLB5FC","seq":21},{"lotteryCode":"JS11X5","seq":22},{"lotteryCode":"GD11X5","seq":23},{"lotteryCode":"SD11X5","seq":24},{"lotteryCode":"AH11X5","seq":25},{"lotteryCode":"SH11X5","seq":26},{"lotteryCode":"BJSC","seq":27},{"lotteryCode":"XG6HC","seq":28}]"""
        # m = MultipartEncoder(fields={'lotteryJson': data})
        # headers = {'Content-Type': m.content_type}
        # self.assertionT('post_x', '/lottery/1.0/lotteryMobilePurchase/updateLotterySeq',
        #                 '/lottery/1.0/lotteryMobilePurchase/updateLotterySeq,彩票-彩种设定-购彩大厅排序',m,headers)
        data = {"lotteryJson": data}
        self.assertionT(
            "post_x",
            "http://admin-service-api.yhtest0.com/lottery/1.0/lotteryMobilePurchase/updateLotterySeq",
            "/lottery/1.0/lotteryMobilePurchase/updateLotterySeq,彩票-彩种设定-购彩大厅排序",
            data,
        )

    def test_how_play(self):
        """ 彩票-玩法开关"""
        self.assertionT(
            "get",
            "http://admin-service-api.yhtest0.com/lottery/1.0/mode/list",
            "/lottery/1.0/mode/list,彩票-玩法开关",
        )
        ClassCode = ["XY28", "SSC", "SC", "k3", "6HC", "11X5"]
        for c in ClassCode:
            self.assertionT(
                "get",
                "http://admin-service-api.yhtest0.com/lottery/1.0/lottery/list?lotteryClassCode="
                + c,
                "/lottery/1.0/lottery/list?lotteryClassCode=" + c + ",彩票-彩种分类",
            )

        lotteryCode = [
            "BJXY28",
            "XXLXY28",
            "JNDXY28",
            "XNXY28",
            "TWXY28",
            "JLPXY28",
            "CQSSC",
            "TJSSC",
            "XJSSC",
            "WFC",
            "FFC",
            "FLB3FC",
            "HL1.5F",
            "FLB5FC",
            "BJSC",
            "XYFT",
            "JSSC",
            "BJSC",
            "XYFT",
            "JSSC",
            "GXK3",
            "AHK3",
            "JLK3",
            "XG6HC",
            "JX11X5",
            "JS115X",
            "GD11X5",
            "SD11X5",
            "AH11X5",
            "SH11X5",
        ]
        modeCode = ["TRADITION", "ROOM", "LIVE"]
        for m in modeCode:
            for l in lotteryCode:
                self.assertionT(
                    "get",
                    "http://admin-service-api.yhtest0.com/lottery/1.0/lotteryGame/list?lotteryCode="
                    + l
                    + "&modeCode="
                    + m,
                    "/lottery/1.0/lotteryGame/list?lotteryCode="
                    + l
                    + "&modeCode="
                    + m
                    + "彩票-彩种名称，彩种模式",
                )
        data = {"id": 197, "type": 1, "config": 2}
        self.assertionT(
            "post_x",
            "http://admin-service-api.yhtest0.com/lottery/1.0/lotteryGame/updateConfig",
            "/lottery/1.0/lotteryGame/updateConfig,彩票-玩法开关-编辑购球数",
            data,
        )
        data = {"id": 197}
        self.assertionT(
            "post_x",
            "http://admin-service-api.yhtest0.com/lottery/1.0/lotteryGame/updateStatus",
            "/lottery/1.0/mode/list,彩票-玩法开关-子玩法-关",
            data,
        )
        data = {"id": 197}
        self.assertionT(
            "post_x",
            "http://admin-service-api.yhtest0.com/lottery/1.0/lotteryGame/updateStatus",
            "/lottery/1.0/mode/list,彩票-玩法开关-子玩法-开",
            data,
        )
        data = {"id": 197, "type": 2, "config": "选择1个数字进行投注,选中开奖号码和值即中奖自动化。"}
        self.assertionT(
            "post_x",
            "http://admin-service-api.yhtest0.com/lottery/1.0/lotteryGame/updateConfig",
            "/lottery/1.0/lotteryGame/updateConfig,彩票-玩法开关-编辑购球提示",
            data,
        )
        data = {"id": 197, "type": 3, "config": "投注号码：5 奖结果为：113/221/122=5都表示中奖自动化自动化。"}
        self.assertionT(
            "post_x",
            "http://admin-service-api.yhtest0.com/lottery/1.0/lotteryGame/updateConfig",
            "/lottery/1.0/lottery/lotteryIconList,彩票-玩法开关-编辑中奖提示",
            data,
        )

    def test_lottery_icon(self):
        """ 彩票-彩种图标"""
        self.assertionT(
            "get",
            "http://admin-service-api.yhtest0.com/lottery/1.0/lottery/lotteryIconList",
            "/lottery/1.0/lottery/lotteryIconList,彩票-彩种图标",
        )
        data = {"id": 197, "type": 3, "config": "投注号码：5 奖结果为：113/221/122=5都表示中奖自动化自动化。"}
        self.assertionT(
            "post_x",
            "http://admin-service-api.yhtest0.com/lottery/1.0/lotteryGame/updateConfig",
            "/lottery/1.0/lottery/lotteryIconList,彩票-彩种图标",
            data,
        )

        lotteryModeId = """[{"lotteryModeId":1,"headIcon":"http://play-img3.ssg6.com/thumb/GALAXY/20190417/1555483956252.png","purchaseIcon":"http://play-img3.ssg6.com/thumb/GALAXY/20190417/1555483961380.png"}]"""
        data = {
            "lotteryId": 1,
            "lotteryModeIcons": lotteryModeId,
            "drawIcon": "https://tcpic.oss-cn-shenzhen.aliyuncs.com/tc/BJXY28.png",
        }
        self.assertionT(
            "post_x",
            "http://admin-service-api.yhtest0.com/lottery/1.0/lottery/updateLotteryIcons",
            "/lottery/1.0/lottery/updateLotteryIcons,彩票-彩种图标",
            data,
        )

    def test_odds_setup(self):
        """ 彩票-赔率设置"""
        url = TestCaseSet().url.getData("odds_setup")
        for u in url:
            self.assertionT("get", u, u + "彩票-赔率设置")
        data = {"id": 394, "type": 1, "num": 2}
        self.assertionT(
            "post_x",
            "http://gateway-api.yhtest0.com/lottery/1.0/lotteryHallGameItemOdds/update",
            "http://gateway-api.yhtest0.com/lottery/1.0/lotteryHallGameItemOdds/update彩票-修改赔率设置",
            data,
        )

    def test_quota_setup(self):
        """ 彩票-限额设置"""
        self.assertionT(
            "get",
            "http://admin-service-api.yhtest0.com/lottery/1.0/lottery/skateLimitList",
            "/lottery/1.0/lottery/skateLimitList,彩票-限额设置",
        )
        self.assertionT(
            "get",
            "http://admin-service-api.yhtest0.com/lottery/1.0/lotteryClass/list",
            "/lottery/1.0/lotteryClass/list,彩票-限额设置",
        )
        data = {"lotteryCode": "BJXY28", "maxTotalSkate": 100000}
        self.assertionT(
            "post_x",
            "http://admin-service-api.yhtest0.com/lottery/1.0/lottery/skateLimit/update/BJXY28",
            "/lottery/1.0/lottery/skateLimit/update/BJXY28,彩票-限额设置-彩种限额-所有单期投注最大限额",
            data,
        )
        data = {"lotteryCode": "BJXY28", "maxSingleSkate": 10000}
        self.assertionT(
            "post_x",
            "http://admin-service-api.yhtest0.com/lottery/1.0/lottery/skateLimit/update/BJXY28",
            "/lottery/1.0/lottery/skateLimit/update/BJXY28,彩票-限额设置-彩种限额-个人单期投注最大限额",
            data,
        )
        data = {"lotteryCode": "BJXY28", "minSkate": 2, "hallId": 4}
        self.assertionT(
            "post_x",
            "http://admin-service-api.yhtest0.com/lottery/1.0/lottery/skateLimit/update/BJXY28",
            "/lottery/1.0/lottery/skateLimit/update/BJXY28,彩票-限额设置-彩种限额-[传统模式]投注最小限额",
            data,
        )
        data = {"lotteryCode": "BJXY28", "minSkate": 2, "hallId": 5}
        self.assertionT(
            "post_x",
            "http://admin-service-api.yhtest0.com/lottery/1.0/lottery/skateLimit/update/BJXY28",
            "/lottery/1.0/lottery/skateLimit/update/BJXY28,彩票-限额设置-彩种限额-[直播模式]投注最小限额",
            data,
        )
        data = {"hallId": 4, "minSkate": 10}
        self.assertionT(
            "post_x",
            "http://admin-service-api.yhtest0.com/lottery/1.0/lottery/skateLimit/update/XY28",
            "/lottery/1.0/lottery/skateLimit/update/BJXY28,彩票-限额设置-彩种限额-限额批量设置",
            data,
        )

        data = {
            "lotteryCode": "BJXY28",
            "lotteryHallId": "115",
            "maxLimit": "2888887",
            "gameId": "21",
        }
        self.assertionT(
            "post_x",
            "http://gateway-api.yhtest0.com/lottery/1.0/lotteryHallGame/maxSkate/update",
            "http://gateway-api.yhtest0.com/lottery/1.0/lotteryHallGame/maxSkate/update,彩票-限额设置-玩法限额-",
            data,
        )

        self.assertionT(
            "get",
            "http://gateway-api.yhtest0.com/lottery/1.0/lotteryHallGame/gameList?lotteryHallId=115&parentGameId=20",
            "http://gateway-api.yhtest0.com/lottery/1.0/lotteryHallGame/gameList?lotteryHallId=115&parentGameId=20,彩票-限额设置-玩法限额",
        )

    def test_self_awarding(self):
        """ 彩票-自开奖管理"""
        url = TestCaseSet().url.getData("self_awarding")
        for u in url:
            self.assertionT("get", u, u + "彩票-自开奖管理")

    def test_history_awards(self):
        """ 彩票-历史开奖"""
        url = TestCaseSet().url.getData("history_awards")
        for u in url:
            self.assertionT("get", u, u + "彩票-历史开奖")

    def test_note_query(self):
        """ 注单-注单查询"""
        url = TestCaseSet().url.getData("note_query")
        for u in url:
            self.assertionT("get", u, u + "注单-注单查询")

    def test_film_management(self):
        """ 互动-影片管理"""

        # 上传影片
        file = open(os.getcwd() + r"\UI\aototestV.mp4", "rb")
        files = {"file": ("blob", file, "application/octet-stream")}
        taskNumber = (
            TestCaseSet()
            .respones.request(
                "get", "http://video-api.yhtest0.com/file/1.0/getTaskNumber"
            )
            .json()
            .get("data")
        )
        data = {"chunks": 1, "chunk": 1, "size": 1847761, "taskNumber": taskNumber}
        self.assertionT(
            "files",
            "http://video-api.yhtest0.com/file/1.0/uploadSlice",
            "http://video-api.yhtest0.com/file/1.0/uploadSlice互动-影片管理-影片上传",
            data=data,
            files=files,
        )
        datetime.time(5)
        data = {"name": "zdhtest", "taskNumber": taskNumber}
        self.assertionT(
            "post_x",
            "http://gateway-api.yhtest0.com/movie/1.0/save",
            "http://gateway-api.yhtest0.com/movie/1.0/save互动-影片管理-影片上传",
            data,
        )

        file.close()

        datetime.time(3)

        url = TestCaseSet().url.getData("film_management")
        for u in url:
            self.assertionT("get", u, u + "互动-影片管理")

        video_list = (
            TestCaseSet()
            .respones.request(
                "get",
                "http://gateway-api.yhtest0.com/movie/1.0/video/list?pageNum=1&pageSize=100",
            )
            .json()
            .get("data")
            .get("data")
        )
        id = 0
        for i in video_list:
            try:
                if i.get("name") == "zdhtest":
                    id = i.get("id")
            except:
                print("影片不存在")

        self.assertionT(
            "get",
            "http://gateway-api.yhtest0.com/movie/1.0/video/list?id="
            + str(id)
            + "&pageNum=1&pageSize=10",
            "http://gateway-api.yhtest0.com/movie/1.0/video/list?id="
            + str(id)
            + "&pageNum=1&pageSize=10&pageSize=10互动-影片管理",
        )
        name = self.nowTime()
        data = {"name": name, "id": id}
        self.assertionT(
            "post_x",
            "http://gateway-api.yhtest0.com/movie/1.0/save",
            "http://gateway-api.yhtest0.com/movie/1.0/save互动-影片管理-编辑",
            data,
        )
        data = {"sort": 2, "id": id}
        self.assertionT(
            "post_x",
            "http://gateway-api.yhtest0.com/movie/1.0/save",
            "http://gateway-api.yhtest0.com/movie/1.0/save互动-影片管理-影片排序",
            data,
        )
        data = {"id": id}
        self.assertionT(
            "post_x",
            "http://gateway-api.yhtest0.com/movie/1.0/delete",
            "http://gateway-api.yhtest0.com/movie/1.0/delete互动-影片管理-删除",
            data,
        )

    def test_Interaction_anchor_management(self):
        """ 互动-主播管理"""

        pic = TestCaseSet().upload_pic()
        # 美女主播
        account = "t" + self.nowTime()
        data = {
            "account": account,
            "password": "a111111",
            account: "自动化测试账号",
            "type": 0,
        }
        self.assertionT(
            "post_x",
            "http://gateway-api.yhtest0.com/anchorInfo/1.0/insert",
            "http://gateway-api.yhtest0.com/anchorInfo/1.0/insert互动-主播管理-新增美女主播",
            data,
        )

        datetime.time(3)
        id = (
            TestCaseSet()
            .respones.request(
                "get",
                "http://gateway-api.yhtest0.com/anchorInfo/1.0/query?pageNum=1&pageSize=10",
            )
            .json()
            .get("data")
            .get("data")
        )
        for i in id:
            if i.get("account") == account:
                id = i.get("id")

        data = {
            "id": id,
            "account": account,
            "nickname": account,
            "type": 0,
            "image": pic,
            "betPercent": 0.2,
            "deficitPercent": 0.2,
        }
        self.assertionT(
            "post_x",
            "http://gateway-api.yhtest0.com/anchorInfo/1.0/update",
            "http://gateway-api.yhtest0.com/anchorInfo/1.0/insert互动-主播管理-上传头像",
            data,
        )

        data = {"id": id, "status": 1}
        self.assertionT(
            "post_x",
            "http://gateway-api.yhtest0.com/anchorInfo/1.0/update",
            "http://gateway-api.yhtest0.com/anchorInfo/1.0/insert互动-主播管理-停用",
            data,
        )
        data = {"id": id, "status": 0}
        self.assertionT(
            "post_x",
            "http://gateway-api.yhtest0.com/anchorInfo/1.0/update",
            "http://gateway-api.yhtest0.com/anchorInfo/1.0/insert互动-主播管理-启用",
            data,
        )

        data = {
            "id": id,
            "account": account,
            "nickname": account,
            "type": 0,
            "image": pic,
            "betPercent": 0.2,
            "deficitPercent": 0.2,
        }
        self.assertionT(
            "post_x",
            "http://gateway-api.yhtest0.com/anchorInfo/1.0/update",
            "http://gateway-api.yhtest0.com/anchorInfo/1.0/insert互动-主播管理-编辑",
            data,
        )
        data = {"id": id, "password": "a111111"}
        self.assertionT(
            "post_x",
            "http://gateway-api.yhtest0.com/anchorInfo/1.0/update",
            "http://gateway-api.yhtest0.com/anchorInfo/1.0/insert互动-主播管理-重置密码",
            data,
        )
        data = {"id": id}
        self.assertionT(
            "post_x",
            "http://gateway-api.yhtest0.com/anchorInfo/1.0/delete",
            "http://gateway-api.yhtest0.com/anchorInfo/1.0/delete互动-主播管理-删除",
            data,
        )
        # 影片主播
        account = "t" + self.nowTime()
        data = {
            "account": account,
            "password": "a111111",
            account: "自动化测试账号",
            "type": 1,
        }
        self.assertionT(
            "post_x",
            "http://gateway-api.yhtest0.com/anchorInfo/1.0/insert",
            "http://gateway-api.yhtest0.com/anchorInfo/1.0/insert互动-主播管理-新增美女主播",
            data,
        )

        datetime.time(3)
        id = (
            TestCaseSet()
            .respones.request(
                "get",
                "http://gateway-api.yhtest0.com/anchorInfo/1.0/query?pageNum=1&pageSize=10",
            )
            .json()
            .get("data")
            .get("data")
        )
        for i in id:
            if i.get("account") == account:
                id = i.get("id")

        data = {
            "id": id,
            "account": account,
            "nickname": account,
            "type": 0,
            "image": pic,
            "betPercent": 0.2,
            "deficitPercent": 0.2,
        }
        self.assertionT(
            "post_x",
            "http://gateway-api.yhtest0.com/anchorInfo/1.0/update",
            "http://gateway-api.yhtest0.com/anchorInfo/1.0/insert互动-主播管理-上传头像",
            data,
        )

        data = {"id": id, "status": 1}
        self.assertionT(
            "post_x",
            "http://gateway-api.yhtest0.com/anchorInfo/1.0/update",
            "http://gateway-api.yhtest0.com/anchorInfo/1.0/insert互动-主播管理-停用",
            data,
        )
        data = {"id": id, "status": 0}
        self.assertionT(
            "post_x",
            "http://gateway-api.yhtest0.com/anchorInfo/1.0/update",
            "http://gateway-api.yhtest0.com/anchorInfo/1.0/insert互动-主播管理-启用",
            data,
        )

        data = {
            "id": id,
            "account": account,
            "nickname": account,
            "type": 1,
            "image": pic,
            "betPercent": 0.2,
            "deficitPercent": 0.2,
        }
        self.assertionT(
            "post_x",
            "http://gateway-api.yhtest0.com/anchorInfo/1.0/update",
            "http://gateway-api.yhtest0.com/anchorInfo/1.0/insert互动-主播管理-编辑",
            data,
        )
        data = {"id": id, "password": "a111111"}
        self.assertionT(
            "post_x",
            "http://gateway-api.yhtest0.com/anchorInfo/1.0/update",
            "http://gateway-api.yhtest0.com/anchorInfo/1.0/insert互动-主播管理-重置密码",
            data,
        )
        data = {"id": id}
        self.assertionT(
            "post_x",
            "http://gateway-api.yhtest0.com/anchorInfo/1.0/delete",
            "http://gateway-api.yhtest0.com/anchorInfo/1.0/delete互动-主播管理-删除",
            data,
        )

    def test_Interaction_Room_management(self):
        """ 互动-房间管理"""

        url = TestCaseSet().url.getData("Interaction_Room_management")

        for u in url:
            self.assertionT("get", u, u + "互动-房间管理")
        image = TestCaseSet().upload_pic()

        anchorId = (
            TestCaseSet()
            .respones.request(
                "get",
                "http://gateway-api.yhtest0.com/anchorInfo/1.0/query?liveStatus=0&type=1&pageNum=1&pageSize=20",
            )
            .json()
            .get("data")
            .get("data")[0]
            .get("id")
        )

        self.assertionT(
            "get",
            "http://gateway-api.yhtest0.com/anchor/covers/1.0/query?anchorId="
            + str(anchorId),
            "http://gateway-api.yhtest0.com/anchor/covers/1.0/query?anchorId互动-房间管理",
        )

        data = {"anchorId": anchorId, "image": image}
        self.assertionT(
            "post_x",
            "http://gateway-api.yhtest0.com/anchor/covers/1.0/insert?",
            "http://gateway-api.yhtest0.com/anchor/covers/1.0/insert?互动-房间管理-进入房间余额",
            data,
        )

        videoId = (
            TestCaseSet()
            .respones.request(
                "get",
                "http://gateway-api.yhtest0.com/movie/1.0/video/list?uploadStatus=1&pageNum=1&pageSize=20",
            )
            .json()
            .get("data")
            .get("data")[0]
            .get("id")
        )
        data = {
            "lotteryCode": "BJXY28",
            "subject": "自动化测试",
            "cover": image,
            "anchorId": anchorId,
            "videoId": videoId,
        }
        self.assertionT(
            "post_x",
            "http://gateway-api.yhtest0.com/liveRoom/1.0/video/create",
            "http://gateway-api.yhtest0.com/liveRoom/1.0/video/create?互动-房间管理",
            data,
        )
        datetime.time(3)

        roomId = (
            TestCaseSet()
            .respones.request(
                "get",
                "http://gateway-api.yhtest0.com/liveRoom/1.0/live/query?pageSize=10&pageNum=1",
            )
            .json()
            .get("data")
            .get("data")[0]
            .get("id")
        )

        data = {"roomId": roomId, "money": 20000}
        self.assertionT(
            "post_x",
            "http://gateway-api.yhtest0.com/liveRoom/1.0/money/update",
            "http://gateway-api.yhtest0.com/liveRoom/1.0/money/update互动-房间管理-进入房间余额",
            data,
        )

        data = {
            "roomId": roomId,
            "robotGrow": 5,
            "robotInitNum": 50,
            "robotBetStatus": 0,
        }
        self.assertionT(
            "post_x",
            "http://gateway-api.yhtest0.com/liveRoom/1.0/robot/config/update?",
            "http://gateway-api.yhtest0.com/liveRoom/1.0/robot/config/update?互动-房间管理-机器人投注",
            data,
        )

        data = {"roomId": roomId}
        self.assertionT(
            "post_x",
            "http://gateway-api.yhtest0.com/liveRoom/1.0/live/close?",
            "http://gateway-api.yhtest0.com/liveRoom/1.0/live/close?互动-房间管理-关闭房间",
            data,
        )
        #

        data = {"accessLiveMinAmount": 100, "speakMinAmount": 10, "speakMaxRate": 5}
        self.assertionT(
            "post_x",
            "http://gateway-api.yhtest0.com/userPrivilege/1.0/updatePrivileges",
            "http://gateway-api.yhtest0.com/userPrivilege/1.0/updatePrivileges互动-房间管理-玩家权限",
            data,
        )
        data = {
            "content": "zdhtest",
            "beginTime": 1557504000000,
            "endTime": "1561910399999",
            "rate": 1,
        }
        self.assertionT(
            "post_x",
            "http://gateway-api.yhtest0.com/roomNotice/1.0/add?",
            "http://gateway-api.yhtest0.com/userPrivilege/1.0/updatePrivileges互动-房间管理-新增房间公告",
            data,
        )

        Notice = (
            TestCaseSet()
            .respones.request(
                "get",
                "http://gateway-api.yhtest0.com/roomNotice/1.0/page?pageNo=1&pageSize=10",
            )
            .json()
            .get("data")
            .get("data")
        )

        id = 0
        for i in Notice:
            if i.get("content") == "自动化测试":
                id = i.get("id")
        data = {
            "id": id,
            "content": "zdhtest",
            "beginTime": 1557504000000,
            "endTime": 1561910399999,
            "rate": 1,
        }
        self.assertionT(
            "post_x",
            "http://gateway-api.yhtest0.com/roomNotice/1.0/update?",
            "http://gateway-api.yhtest0.com/roomNotice/1.0/update?互动-房间管理-编辑房间公告",
            data,
        )
        self.assertionT(
            "get",
            "http://gateway-api.yhtest0.com/roomNotice/1.0/delete?id=" + str(id),
            "http://gateway-api.yhtest0.com/roomNotice/1.0/delete?id="
            + str(id)
            + "互动-房间管理-删除房间公告",
        )

    def test_1314odds_setup(self):
        """ 互动-主播报表"""
        url = TestCaseSet().url.getData("anchor_report")

        for u in url:
            self.assertionT("get", u, u + "互动-主播报表")

    def test_chat_room(self):
        """ 互动-聊天室管理"""
        url = TestCaseSet().url.getData("chat_room")

        for u in url:
            self.assertionT("get", u, u + "互动-聊天室管理")

        data = {
            "type": 0,
            "time": "00:00:00-23:05:01",
            "interval": 1,
            "intervalType": 0,
            "content": "全体自动化测试",
        }
        self.assertionT(
            "post_x",
            "http://gateway-api.yhtest0.com/chatsysmsg/1.0/addorupdate",
            "http://gateway-api.yhtest0.com/chatsysmsg/1.0/addorupdate互动-聊天室管理-新增消息-全体发送",
            data,
        )

        data = {
            "type": 1,
            "time": "00:00:00-00:00:00",
            "interval": 0,
            "intervalType": 0,
            "content": "新用户自动化测试",
        }
        self.assertionT(
            "post_x",
            "http://gateway-api.yhtest0.com/chatsysmsg/1.0/addorupdate",
            "http://gateway-api.yhtest0.com/chatsysmsg/1.0/addorupdate互动-聊天室管理-新增消息-新用户发送",
            data,
        )

        data = {
            "type": 2,
            "time": "00:00:00-00:00:00",
            "interval": 0,
            "intervalType": 0,
            "content": "新进用户自动化测试",
        }
        self.assertionT(
            "post_x",
            "http://gateway-api.yhtest0.com/chatsysmsg/1.0/addorupdate",
            "http://gateway-api.yhtest0.com/chatsysmsg/1.0/addorupdate互动-聊天室管理-新增消息-新进用户发送",
            data,
        )

        id = (
            TestCaseSet()
            .respones.request(
                "get",
                "http://gateway-api.yhtest0.com/chatsysmsg/1.0/page?pageNum=1&pageSize=10",
            )
            .json()
            .get("data")
            .get("data")[0]
            .get("id")
        )
        data = {
            "type": 2,
            "id": id,
            "interval": 0,
            "intervalType": 0,
            "content": "新进用户自动化测试修改",
        }
        self.assertionT(
            "post_x",
            "http://gateway-api.yhtest0.com/chatsysmsg/1.0/addorupdate",
            "http://gateway-api.yhtest0.com/chatsysmsg/1.0/addorupdate互动-聊天室管理-编辑消息",
            data,
        )

        data = {"status": 0, "id": id}
        self.assertionT(
            "post_x",
            "http://gateway-api.yhtest0.com/chatsysmsg/1.0/update/status",
            "http://gateway-api.yhtest0.com/chatsysmsg/1.0/update/status互动-聊天室管理-新增消息-停用",
            data,
        )

        data = {"status": 1, "id": id}
        self.assertionT(
            "post_x",
            "http://gateway-api.yhtest0.com/chatsysmsg/1.0/update/status",
            "http://gateway-api.yhtest0.com/chatsysmsg/1.0/update/status互动-聊天室管理-新增消息-启用",
            data,
        )

        data = {"status": -1, "id": id}
        self.assertionT(
            "post_x",
            "http://gateway-api.yhtest0.com/chatsysmsg/1.0/update/status",
            "http://gateway-api.yhtest0.com/chatsysmsg/1.0/update/status互动-聊天室管理-新增消息-删除",
            data,
        )

        data = {"title": "自动化测试", "content": "自动化测试", "status": 1}
        self.assertionT(
            "post_x",
            "http://gateway-api.yhtest0.com/chatRoomNotice/1.0/add",
            "http://gateway-api.yhtest0.com/chatRoomNotice/1.0/add互动-聊天室管理-公告管理-新增公告",
            data,
        )

        id = (
            TestCaseSet()
            .respones.request(
                "get",
                "http://gateway-api.yhtest0.com/chatRoomNotice/1.0/page?pageNum=1&pageSize=10",
            )
            .json()
            .get("data")
            .get("data")[0]
            .get("id")
        )

        data = {"title": "自动化测试", "content": "自动化测试修改", "id": id, "status": 1}
        self.assertionT(
            "post_x",
            "http://gateway-api.yhtest0.com/chatRoomNotice/1.0/update",
            "http://gateway-api.yhtest0.com/chatRoomNotice/1.0/update互动-聊天室管理-公告管理-编辑公告",
            data,
        )

        data = {"title": "自动化测试", "content": "自动化测试修改", "id": id, "status": 0}
        self.assertionT(
            "post_x",
            "http://gateway-api.yhtest0.com/chatRoomNotice/1.0/update",
            "http://gateway-api.yhtest0.com/chatRoomNotice/1.0/update互动-聊天室管理-公告管理-禁用",
            data,
        )

        data = {"title": "自动化测试", "content": "自动化测试修改", "id": id, "status": 1}
        self.assertionT(
            "post_x",
            "http://gateway-api.yhtest0.com/chatRoomNotice/1.0/update",
            "http://gateway-api.yhtest0.com/chatRoomNotice/1.0/update互动-聊天室管理-公告管理-启用",
            data,
        )

        data = {"id": id}
        self.assertionT(
            "post_x",
            "http://gateway-api.yhtest0.com/chatRoomNotice/1.0/delete",
            "http://gateway-api.yhtest0.com/chatRoomNotice/1.0/delete互动-聊天室管理-公告管理-删除",
            data,
        )

        data = {"id": id}
        self.assertionT(
            "post_x",
            "http://gateway-api.yhtest0.com/chatRoomNotice/1.0/delete",
            "http://gateway-api.yhtest0.com/chatRoomNotice/1.0/delete互动-聊天室管理-公告管理-删除",
            data,
        )

        imgUrl = TestCaseSet().upload_pic()

        data = {"name": "自动化测试", "imgUrl": imgUrl}
        self.assertionT(
            "post_x",
            "http://gateway-api.yhtest0.com/robot/1.0/save",
            "http://gateway-api.yhtest0.com/robot/1.0/save互动-聊天室管理-机器人-新增机器人",
            data,
        )

        jq_id = (
            TestCaseSet()
            .respones.request(
                "get",
                "http://gateway-api.yhtest0.com/robot/1.0/queryList?pageNum=1&pageSize=10",
            )
            .json()
            .get("data")
            .get("data")
        )

        ren_id = 0
        for i in jq_id:
            if i.get("name") == "自动化测试":
                ren_id = i.get("id")
        #
        #
        data = {"name": "自动化测试修改", "imgUrl": imgUrl, "id": ren_id}
        self.assertionT(
            "post_x",
            "http://gateway-api.yhtest0.com/robot/1.0/save",
            "http://gateway-api.yhtest0.com/robot/1.0/save互动-聊天室管理-机器人-机器人修改",
            data,
        )

        data = {
            "content": "自动化测试消息--常规消息",
            "minAmount": 100,
            "maxAmount": 100,
            "msgType": 1,
            "minInterval": 1,
            "maxInterval": 2,
            "startTime": "00:00:00",
            "endTime": "23:00:00",
            "robots": ren_id,
            "timeType": 0,
        }
        self.assertionT(
            "post_x",
            "http://gateway-api.yhtest0.com/robotMsgConfig/1.0/save",
            "http://gateway-api.yhtest0.com/robotMsgConfig/1.0/save互动-聊天室管理-机器人-新增常规消息",
            data,
        )

        # 获取消息ID
        rob_id = (
            TestCaseSet()
            .respones.request(
                "get",
                "http://gateway-api.yhtest0.com/robotMsgConfig/1.0/queryList?pageNum=1&pageSize=10",
            )
            .json()
            .get("data")
            .get("data")
        )

        id = 0
        robots = 0
        for i in rob_id:
            if i.get("content") == "自动化测试消息--常规消息":
                id = i.get("id")
                robots = i.get("robotIds")

        data = {
            "content": "自动化测试消息--常规消息修改",
            "minAmount": 100,
            "maxAmount": 100,
            "msgType": 1,
            "minInterval": 1,
            "maxInterval": 2,
            "startTime": "00:00:00",
            "endTime": "23:00:00",
            "robots": robots,
            "timeType": 0,
            "id": id,
        }
        self.assertionT(
            "post_x",
            "http://gateway-api.yhtest0.com/robotMsgConfig/1.0/save",
            "http://gateway-api.yhtest0.com/robotMsgConfig/1.0/save互动-聊天室管理-机器人-消息修改",
            data,
        )

        data = {"id": id}

        self.assertionT(
            "post_x",
            "http://gateway-api.yhtest0.com/robotMsgConfig/1.0/start",
            "http://gateway-api.yhtest0.com/robotMsgConfig/1.0/start互动-聊天室管理-机器人-消息启用",
            data,
        )

        data = {"id": id}
        self.assertionT(
            "post_x",
            "http://gateway-api.yhtest0.com/robotMsgConfig/1.0/stop",
            "http://gateway-api.yhtest0.com/robotMsgConfig/1.0/stop互动-聊天室管理-机器人-消息停用",
            data,
        )

        data = {"id": id, "status": -1}
        self.assertionT(
            "post_x",
            "http://gateway-api.yhtest0.com/robotMsgConfig/1.0/delete",
            "http://gateway-api.yhtest0.com/robotMsgConfig/1.0/delete互动-聊天室管理-机器人-消息删除",
            data,
        )

        data = {
            "minAmount": 100,
            "maxAmount": 10000,
            "games[BJXY28]": "北京幸运28",
            "games[JNDXY28]": "加拿大幸运28",
            "games[BJSC]": "北京赛车",
            "games[XYFT]": "幸运飞艇",
            "games[JSSC]": "极速赛车",
            "games[FFC]": "分分彩",
            "games[FLB3FC]": "菲律宾3分彩",
            "msgType": 2,
            "minInterval": 1,
            "maxInterval": 2,
            "startTime": "00:00:00",
            "endTime": "23:00:00",
            "robots": id,
            "timeType": 0,
        }
        self.assertionT(
            "post_x",
            "http://gateway-api.yhtest0.com/robotMsgConfig/1.0/save",
            "http://gateway-api.yhtest0.com/robotMsgConfig/1.0/save互动-聊天室管理-机器人-新增投注消息",
            data,
        )

        rob_id = (
            TestCaseSet()
            .respones.request(
                "get",
                "http://gateway-api.yhtest0.com/robotMsgConfig/1.0/queryList?pageNum=1&pageSize=10",
            )
            .json()
            .get("data")
            .get("data")[0]
        )

        id = rob_id.get("id")

        data = {
            "id": id,
            "minAmount": 100,
            "maxAmount": 10000,
            "games[BJXY28]": "北京幸运28",
            "games[JNDXY28]": "加拿大幸运28",
            "games[BJSC]": "北京赛车",
            "games[XYFT]": "幸运飞艇",
            "games[JSSC]": "极速赛车",
            "games[FFC]": "分分彩",
            "games[FLB3FC]": "菲律宾3分彩",
            "msgType": 2,
            "minInterval": 1,
            "maxInterval": 2,
            "startTime": "00:00:00",
            "endTime": "23:00:00",
            "robots": robots,
            "timeType": 0,
        }

        self.assertionT(
            "post_x",
            "http://gateway-api.yhtest0.com/robotMsgConfig/1.0/save",
            "http://gateway-api.yhtest0.com/robotMsgConfig/1.0/save互动-聊天室管理-机器人-编辑投注消息",
            data,
        )

        data = {"id": id}

        self.assertionT(
            "post_x",
            "http://gateway-api.yhtest0.com/robotMsgConfig/1.0/start",
            "http://gateway-api.yhtest0.com/robotMsgConfig/1.0/start互动-聊天室管理-机器人-消息启用",
            data,
        )

        data = {"id": id}
        self.assertionT(
            "post_x",
            "http://gateway-api.yhtest0.com/robotMsgConfig/1.0/stop",
            "http://gateway-api.yhtest0.com/robotMsgConfig/1.0/stop互动-聊天室管理-机器人-消息停用",
            data,
        )

        data = {"id": id, "status": -1}
        self.assertionT(
            "post_x",
            "http://gateway-api.yhtest0.com/robotMsgConfig/1.0/delete",
            "http://gateway-api.yhtest0.com/robotMsgConfig/1.0/delete互动-聊天室管理-机器人-消息删除",
            data,
        )

        data = {"id": ren_id}
        self.assertionT(
            "post_x",
            "http://gateway-api.yhtest0.com/robot/1.0/delete",
            "http://gateway-api.yhtest0.com/robot/1.0/delete互动-聊天室管理-机器人-删除机器人",
            data,
        )

        data = {
            "closeTimeBegin": "02:00:00",
            "closeTimeEnd": "04:00:00",
            "speakInterval": 2,
        }
        self.assertionT(
            "post_x",
            "http://gateway-api.yhtest0.com/sys/1.0/globConfig/chatRoom/update",
            "http://gateway-api.yhtest0.com/sys/1.0/globConfig/chatRoom/update互动-聊天室管理-聊天室设置",
            data,
        )

    def test_award(self):
        """ 系统-系统设置"""
        print(1)
        self.assertionT(
            "get",
            "http://gateway-api.yhtest0.com/sys/1.0/globConfig/payCash",
            "http://gateway-api.yhtest0.com/sys/1.0/globConfig/payCash,系统-系统设置",
        )

        payDot = {
            "payDot": "true",
            "payFastVal": "100,2000,3000,100000",
            "payDepcatSubmit": "true",
            "payMoneyLimit": "1,100000",
            "payFast": "true",
            "min": 1,
            "max": 100000,
        }
        cash = {
            "rechargeCashTimeLimit": "09:00-23:00",
            "rechargeCashDayLimitTimes": 10,
            "rechargeCashLimit": "1,1000",
            "rechargeCashPwdErrTimes": 5,
            "rechargeCashMobile": "false",
            "rechargeCashEmail": "false",
            "rechargeCashIdcard": "false",
            "timesLimit": ["09:00", "23:10"],
            "min": 1,
            "max": 5000,
        }
        fastSkate = {
            "item1": 200,
            "item2": 500,
            "item3": 1000,
            "item4": 2000,
            "item5": 5000,
            "min": 2,
            "max": 20000,
        }
        advertisement = {
            "pcUrl": "http://www.yhuat0.com",
            "h5Url": "http://m.yhuat0.com",
            "jumpUrl": "http://extension.yhuat0.com",
            "advertisementAppDownloadUrl": "http://extension.yhuat0.com",
            "appDownloadUrl": "http://download.yhuat0.com",
            "appDownloadName": "兔牙uat",
            "appDownloadDesc": "兔牙uatapp",
        }

        data = {
            "pay": payDot,
            "cash": cash,
            "fastSkate": fastSkate,
            "advertisement": advertisement,
        }
        self.assertionT(
            "post",
            "http://gateway-api.yhtest0.com/sys/1.0/globConfig/payCash/update",
            "http://gateway-api.yhtest0.com/sys/1.0/globConfig/payCash/update,系统-系统设置-保存系统设置",
            json=data,
        )


# if __name__ == "__main__":
#     unittest.main()
